﻿@namespace Blazorise.Docs.Docs.Examples

<DataGrid TItem="Employee"
          Data="@employeeList"
          Responsive
          ShowPager
          Groupable
          GroupBy="(x=> new { x.Childrens, x.Gender} )">
    <DataGridCommandColumn />
    <DataGridColumn Field="@nameof(Employee.Id)" Caption="#" Sortable="false" />
    <DataGridColumn Field="@nameof(Employee.FirstName)" Caption="First Name" Editable />
    <DataGridColumn Field="@nameof(Employee.LastName)" Caption="Last Name" Editable />
    <DataGridColumn Field="@nameof(Employee.Email)" Caption="Email" Editable />
    <DataGridColumn Field="@nameof(Employee.Gender)" Caption="Gender" Editable />
    <DataGridColumn Field="@nameof(Employee.Childrens)" Caption="Children" Editable />
    <DataGridColumn Field="@nameof(Employee.IsActive)" Caption="Active" Editable />
</DataGrid>

@code{
    [Inject] public EmployeeData EmployeeData { get; set; }
    private List<Employee> employeeList;

    protected override async Task OnInitializedAsync()
    {
        employeeList = await EmployeeData.GetDataAsync();
        await base.OnInitializedAsync();
    }
}